import axios from 'axios'

export function requestFromWebApi(config) {
    const instance = axios.create({
        timeout: 5000,
   })
    //设置post的Content-Type
    instance.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
    instance.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
    //设置token
    instance.interceptors.request.use(
        config=>{
            config.headers.Authorization = localStorage.getItem("token");
            // console.log('*****config****requestForm8082',config);
            return config;
        }
    )
    return instance(config);
}







